package cmd

import (
	"stwin.net/demo/internal/conf"
	"stwin.net/zoro/zconfig"
	"stwin.net/zoro/zoro"
)

var (
	Version = "0.0.0" // 后续需要从一个启动服务上动态获取
)

func NewApp() *zoro.Zoro {
	bs := new(conf.BootStrap)
	zconfig.NewZConfig(bs, Version, func() {}) // 现将配置信息注入
	zo, closeFunc := wireApp(bs, Version, bs.DataConf)
	return zo.SetBeforeStopFunc(closeFunc)
}
